<%@ Page Title="" Language="C#" MasterPageFile="~/RealtimeSite.master" AutoEventWireup="true" CodeFile="EmployeeList.aspx.cs" Inherits="EmployeeList" %>

<%@ Register   Assembly="AjaxControlToolkit"
    Namespace="AjaxControlToolkit"
    TagPrefix="ajaxToolkit" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">

    <style type="text/css">

.green-colour{
background-color:#8dc234;
font-family:Tahoma;
font-size:17px;
padding-left:4px;
color:#ffffff;
margin:2px;
text-decoration:none;
font-weight:bold;
}
.user{
font-family:Tahoma;
font-size:12px;
color:#124c56;
margin:4px;
text-decoration:none;
}
        .button1
        {
            font-style: italic;
        }
                        .card [class*=card-header-]:not(.card-header-icon):not(.card-header-text):not(.card-header-image) {
    border-radius: 3px;
      margin-top: -37px;
    padding: 7px !important;
}
.table>tbody>tr>td, .table>tbody>tr>th, .table>tfoot>tr>td, .table>tfoot>tr>th, .table>thead>tr>td, .table>thead>tr>th {
    padding: 8px 8px !important;
    vertical-align: middle;
    border-color: #ddd;
}
.card-title label
{
    color:#fff !important;
    position:relative;
    top:5px;
}
        </style>
    <script>
        document.addEventListener("DOMContentLoaded", function (event) {
            console.log("Dom loaded");
            var chkol = document.getElementById("MainContent_Grid1_chkallop_0");
            var trtbl = document.getElementById("MainContent_Grid1");
            var trchks = trtbl.querySelectorAll('input[type="checkbox"]');
            //console.log(trchks.length);
            chkol.addEventListener('change', function (event) {
                console.log("checked");
                 if (this.checked) {
                    //console.log("Checkbox is checked..");
                     for (i = 0; i < trchks.length; i++) {
                         trchks[i].checked = true;
                     }
                    } else {
                        for (i = 0; i < trchks.length; i++) {
                         trchks[i].checked = false;
                     }
                    }
            });
        });       
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
      <div class="main-panel">
        <div class="content">
        <div class="container" id="Employee1234" runat="server">
     <div class="row dash-pane2">	
     <div class="card">
                <div class="card-header card-header-warning" id="cardheadergreen" runat="server">
                <div class="row">
                <div class="col-lg-4">
                  <h4 class="card-title"><i class="fa fa-list fa-fw"></i><asp:Label ID="lblListofAllEmployee" runat="server" Text="List of All Employee"></asp:Label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                    <span style="color:#fff !important;"><asp:CheckBox ID="CheckBox1" runat="server" 
                                        oncheckedchanged="CheckBox1_CheckedChanged" 
                                        Text="Select All/Un-Select ALL" Visible="False" /></span></h4></div>
                    <div class="col-lg-6">
                    <ul class="list-inline" style="display:flex">
                     <li><div style="background:#d4c50d; width:80px"><asp:RadioButton ID="RadioButton3" 
                             GroupName="dd" Checked="true"
                            runat="server" AutoPostBack="True" 
                             oncheckedchanged="RadioButton3_CheckedChanged" /> All</div></li>&nbsp;&nbsp;&nbsp;
                    <li><div style="background:green; width:80px"><asp:RadioButton ID="RadioButton1" GroupName="dd"
                            runat="server" AutoPostBack="True" 
                            oncheckedchanged="RadioButton1_CheckedChanged" /> Active</div></li>&nbsp;&nbsp;&nbsp;
                    <li><div style="background:red; width:80px"><asp:RadioButton ID="RadioButton2" GroupName="dd"
                            runat="server" AutoPostBack="True" 
                            oncheckedchanged="RadioButton2_CheckedChanged" /> In Active</div></li>
                   
                    </ul>
                    </div>
   
                 </div>
                </div>
                <div class="card-body table-responsive" style="height:420px; overflow-x:hidden; overflow-y:scroll">
                 
                             <asp:GridView ID="Grid1" runat="server" class="table table-bordered table-hover table-striped"
          AutoGenerateColumns="False"  DataKeyNames="EmpId" 
         
        ondatabound="Grid1_DataBound" >
         
         
          <Columns>
              <asp:TemplateField HeaderText="Select">
                 <HeaderStyle CssClass="tdsubcellheadingfont" ForeColor="Black" Height="21px" Width="30px" />  
                  <ItemTemplate>
                      <asp:CheckBox ID="cbRows" runat="server" />
                  </ItemTemplate>
                
              </asp:TemplateField>
              <asp:HyperLinkField DataNavigateUrlFields="EmpId" ControlStyle-ForeColor="#006699"
                  DataNavigateUrlFormatString="Employee.aspx?RowId={0}" 
                  DataTextField="EmpName" HeaderText="Employee Name" 
                  SortExpression="EmpName">
              
              </asp:HyperLinkField>
                  <asp:BoundField DataField="Cardno" HeaderText="Card no." SortExpression="FatherName" ItemStyle-Width="70px">
               
            </asp:BoundField>
              
             <asp:BoundField DataField="EmpCode" HeaderText="Emp. Code" SortExpression="EmpCode" ItemStyle-Width="70px">
              
            </asp:BoundField>
            <asp:BoundField DataField="Dept_Name" HeaderText="Dept. Name" SortExpression="Dept_Name">
               
            </asp:BoundField>
            <asp:BoundField DataField="Desig_Name" HeaderText="Designation Name" SortExpression="Desig_Name">
                
            </asp:BoundField>
            <asp:BoundField DataField="DateofJoin" HeaderText="Password" SortExpression="DateofJoin" ItemStyle-Width="70px">
               
         </asp:BoundField>
              <asp:BoundField DataField="Branch" HeaderText="Branch" SortExpression="Branch">
               
            </asp:BoundField>
           </Columns>
         
      </asp:GridView>
     

 
      <script type="text/javascript" src="jquery.min.js" ></script>
    <script type="text/javascript" src="quicksearch.js"></script>
    <script type="text/javascript">
        $(function () {
            $('.search_textbox').each(function (i) {
                $(this).quicksearch("[id*=Grid1] tr:not(:has(th))", {
                    'testQuery': function (query, txt, row) {
                        return $(row).children(":eq(" + i + ")").text().toLowerCase().indexOf(query[0].toLowerCase()) != -1;
                    }
                });
            });
        });
    </script>
                </div>
              </div>

              <div class="row" style="margin-left:auto; margin-right:auto; display:table; margin-top:0px;">
                 <asp:Button ID="BtnAdd" runat="server" Text="Add " onclick="BtnAdd_Click" 
        type="button" class="btn btn-success " /><i class="fa fa-plus;"></i>&nbsp;&nbsp;
        <asp:Button ID="BtnDel" runat="server" type="button" Text="Delete" onclick="BtnDel_Click" 
           class="btn btn-danger"
           /><i  class="fa fa-trash-o;"></i>&nbsp;&nbsp;
           <asp:Button ID="BtnImportFromExcel" runat="server" Text="Import from Excel" onclick="BtnImportFromExcel_Click" 
            type="button" class="btn btn-success " /><i class="fa fa-plus;"></i>&nbsp;&nbsp;
        
            
            
                   <asp:Button ID="Button2" runat="server" Text="Export Excel"
            type="button" class="btn btn-success " onclick="Button2_Click" />
            &nbsp;&nbsp;
            <asp:Button ID="Button1" runat="server" 
            Text="Close" class=" btn btn-danger"
            onclick="Button1_Click"  />
              </div>
     

            </div>



</div></div></div>
   
    
</asp:Content>

